<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>command与menu的结合使用</title>
<script type="text/javascript" language="javascript">
function command_click(strS)
{
	document.getElementById("dialog").style.display="block";
	var strContent="正在操作<font color=red> "+strS+" </font>选项";
	document.getElementById("divTip").innerHTML=strContent;
	}
</script>
<style type="text/css">
body{
	padding:5px;
	font-size:12px
	}
menu{
	padding-left:10px;
	padding-bottom:10px;
	display:block;
	border:solid 1px #365167;
	width:40px;
	height:50px;
	}
command{/*无效*/
	float:left;
	margin:5px;
	width:30px;
	cursor:hand;
	}
#dialog{
	display:none;
	position:absolute;/*绝对位置*/
	left:25%;
	top:9%;
	font-size:13px;
	width:320px;
	height:150px;
	border:#666 solid 3px;
	}
#dialog .title{
	padding:5px;
	background-color:#eee;
	height:21px;
	line-height:21px;
	}
#dialog .title .fleft{
	float:left;
	}
#dialog .title .fright{
	float:right;
	}
#dialog .content{
	padding:50px;
	}
</style>
</head>

<body>
<menu>
<command onClick="command_click('文件')">文件</command>
<command onClick="command_click('打开')">打开</command>
</menu>
<div id="dialog">
	<div class="title">
        <div class="fleft">提示</div>
        <div class="fright">关闭</div>
    </div>
    <div class="content">
        <div id="divTip"></div>
    </div>
</div>

</body>
</html>
